#!/usr/bin/python

import csv
import numpy
import sys, getopt

# Example: python getTable.py input.csv output.csv

ifile=open(sys.argv[1], "rb")
reader=csv.reader(ifile)
ofile=open(sys.argv[2], "wb")
writer = csv.writer(ofile, delimiter='\t')

table = []
for row in reader:
	for columns in row:
		list = columns.split("\t")
		# DATE indexes
		#writer.writerow([list[0], ",", list[8], ",", list[11], ",", list[14], ",", list[17]])
		# FACT indexes	
		#writer.writerow([list[0], ",", list[29], ",", list[32], ",", list[35], ",", list[38], ",", list[41], ",", list[44]])
		# GPE indexes
		#writer.writerow([list[0], ",", list[50], ",", list[53], ",", list[56], ",", list[59], ",", list[62], ",", list[65], ",", list[68], ",", list[71]])
		# LOC indexes
		#writer.writerow([list[0], ",", list[80], ",", list[83], ",", list[86], ",", list[89]])
		# NORP indexes
		#writer.writerow([list[0], ",", list[95], ",", list[98], ",", list[101], ",", list[104]])
		# ORG indexes
		writer.writerow([list[0], ",", list[110], ",", list[113], ",", list[116], ",", list[119], ",", list[122], ",", list[125]])
		# ORG DESC indexes
		#writer.writerow([list[0], ",", list[128], ",", list[131], ",", list[134], ",", list[137], ",", list[140]])
		# MIX indexes
		#writer.writerow([list[0], ",", list[2], ",", list[20], ",", list[47], ",", list[74], ",", list[146]])
		# EVET indexes
		#writer.writerow([list[0], ",", list[23], ",", list[26]])


ifile.close()
ofile.close()


print 'Done!'

























